home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / AIncludes / Icons.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  49.7 KB  |  1,817 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Icons.a
  3. ;
  4. ;    Contains:    Icon Utilities and Icon Services Interfaces.
  5. ;
  6. ;    Version:    Technology:    Mac OS 8
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1990-1998 by Apple Computer, Inc. All rights reserved
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__ICONS__') = 'UNDEFINED' THEN
  18. __ICONS__ SET 1
  19.  
  20.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  21.     include 'MacTypes.a'
  22.     ENDIF
  23.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  24.     include 'Quickdraw.a'
  25.     ENDIF
  26.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  27.     include 'Files.a'
  28.     ENDIF
  29.     IF &TYPE('__CODEFRAGMENTS__') = 'UNDEFINED' THEN
  30.     include 'CodeFragments.a'
  31.     ENDIF
  32.  
  33. ;  The following are icons for which there are both icon suites and SICNs. 
  34. ;  Avoid using icon resources if possible. Use IconServices instead. 
  35.  
  36. kGenericDocumentIconResource    EQU        -4000
  37. kGenericStationeryIconResource    EQU        -3985
  38. kGenericEditionFileIconResource    EQU        -3989
  39. kGenericApplicationIconResource    EQU        -3996
  40. kGenericDeskAccessoryIconResource EQU    -3991
  41. kGenericFolderIconResource        EQU        -3999
  42. kPrivateFolderIconResource        EQU        -3994
  43. kFloppyIconResource                EQU        -3998
  44. kTrashIconResource                EQU        -3993
  45. kGenericRAMDiskIconResource        EQU        -3988
  46. kGenericCDROMIconResource        EQU        -3987
  47. ;  The following are icons for which there are SICNs only. 
  48. ;  Avoid using icon resources if possible. Use IconServices instead. 
  49.  
  50. kDesktopIconResource            EQU        -3992
  51. kOpenFolderIconResource            EQU        -3997
  52. kGenericHardDiskIconResource    EQU        -3995
  53. kGenericFileServerIconResource    EQU        -3972
  54. kGenericSuitcaseIconResource    EQU        -3970
  55. kGenericMoverObjectIconResource    EQU        -3969
  56. ;  The following are icons for which there are icon suites only. 
  57. ;  Avoid using icon resources if possible. Use IconServices instead. 
  58.  
  59. kGenericPreferencesIconResource    EQU        -3971
  60. kGenericQueryDocumentIconResource EQU    -16506
  61. kGenericExtensionIconResource    EQU        -16415
  62. kSystemFolderIconResource        EQU        -3983
  63. kHelpIconResource                EQU        -20271
  64. kAppleMenuFolderIconResource    EQU        -3982
  65. ;  Obsolete. Use named constants defined above. 
  66.  
  67. genericDocumentIconResource        EQU        -4000
  68. genericStationeryIconResource    EQU        -3985
  69. genericEditionFileIconResource    EQU        -3989
  70. genericApplicationIconResource    EQU        -3996
  71. genericDeskAccessoryIconResource EQU    -3991
  72. genericFolderIconResource        EQU        -3999
  73. privateFolderIconResource        EQU        -3994
  74. floppyIconResource                EQU        -3998
  75. trashIconResource                EQU        -3993
  76. genericRAMDiskIconResource        EQU        -3988
  77. genericCDROMIconResource        EQU        -3987
  78. desktopIconResource                EQU        -3992
  79. openFolderIconResource            EQU        -3997
  80. genericHardDiskIconResource        EQU        -3995
  81. genericFileServerIconResource    EQU        -3972
  82. genericSuitcaseIconResource        EQU        -3970
  83. genericMoverObjectIconResource    EQU        -3969
  84. genericPreferencesIconResource    EQU        -3971
  85. genericQueryDocumentIconResource EQU    -16506
  86. genericExtensionIconResource    EQU        -16415
  87. systemFolderIconResource        EQU        -3983
  88. appleMenuFolderIconResource        EQU        -3982
  89. ;  Avoid using icon resources if possible. Use IconServices instead. 
  90.  
  91. kStartupFolderIconResource        EQU        -3981
  92. kOwnedFolderIconResource        EQU        -3980
  93. kDropFolderIconResource            EQU        -3979
  94. kSharedFolderIconResource        EQU        -3978
  95. kMountedFolderIconResource        EQU        -3977
  96. kControlPanelFolderIconResource    EQU        -3976
  97. kPrintMonitorFolderIconResource    EQU        -3975
  98. kPreferencesFolderIconResource    EQU        -3974
  99. kExtensionsFolderIconResource    EQU        -3973
  100. kFontsFolderIconResource        EQU        -3968
  101. kFullTrashIconResource            EQU        -3984
  102. ;  Obsolete. Use named constants defined above. 
  103.  
  104. startupFolderIconResource        EQU        -3981
  105. ownedFolderIconResource            EQU        -3980
  106. dropFolderIconResource            EQU        -3979
  107. sharedFolderIconResource        EQU        -3978
  108. mountedFolderIconResource        EQU        -3977
  109. controlPanelFolderIconResource    EQU        -3976
  110. printMonitorFolderIconResource    EQU        -3975
  111. preferencesFolderIconResource    EQU        -3974
  112. extensionsFolderIconResource    EQU        -3973
  113. fontsFolderIconResource            EQU        -3968
  114. fullTrashIconResource            EQU        -3984
  115.  
  116. kHuge1BitMask                    EQU        'ich#'
  117. kHuge4BitData                    EQU        'ich4'
  118. kHuge8BitData                    EQU        'ich8'
  119. kHuge32BitData                    EQU        'ih32'
  120. kHuge8BitMask                    EQU        'h8mk'
  121. kLarge1BitMask                    EQU        'ICN#'
  122. kLarge4BitData                    EQU        'icl4'
  123. kLarge8BitData                    EQU        'icl8'
  124. kLarge32BitData                    EQU        'il32'
  125. kLarge8BitMask                    EQU        'l8mk'
  126. kSmall1BitMask                    EQU        'ics#'
  127. kSmall4BitData                    EQU        'ics4'
  128. kSmall8BitData                    EQU        'ics8'
  129. kSmall32BitData                    EQU        'is32'
  130. kSmall8BitMask                    EQU        's8mk'
  131. kMini1BitMask                    EQU        'icm#'
  132. kMini4BitData                    EQU        'icm4'
  133. kMini8BitData                    EQU        'icm8'
  134. ;  Obsolete. Use names defined above. 
  135.  
  136. large1BitMask                    EQU        'ICN#'
  137. large4BitData                    EQU        'icl4'
  138. large8BitData                    EQU        'icl8'
  139. small1BitMask                    EQU        'ics#'
  140. small4BitData                    EQU        'ics4'
  141. small8BitData                    EQU        'ics8'
  142. mini1BitMask                    EQU        'icm#'
  143. mini4BitData                    EQU        'icm4'
  144. mini8BitData                    EQU        'icm8'
  145. ;  Alignment type values. 
  146.  
  147. kAlignNone                        EQU        $00
  148. kAlignVerticalCenter            EQU        $01
  149. kAlignTop                        EQU        $02
  150. kAlignBottom                    EQU        $03
  151. kAlignHorizontalCenter            EQU        $04
  152. kAlignAbsoluteCenter            EQU        $05
  153. kAlignCenterTop                    EQU        $06
  154. kAlignCenterBottom                EQU        $07
  155. kAlignLeft                        EQU        $08
  156. kAlignCenterLeft                EQU        $09
  157. kAlignTopLeft                    EQU        $0A
  158. kAlignBottomLeft                EQU        $0B
  159. kAlignRight                        EQU        $0C
  160. kAlignCenterRight                EQU        $0D
  161. kAlignTopRight                    EQU        $0E
  162. kAlignBottomRight                EQU        $0F
  163. ;  Obsolete. Use names defined above. 
  164.  
  165. atNone                            EQU        $00
  166. atVerticalCenter                EQU        $01
  167. atTop                            EQU        $02
  168. atBottom                        EQU        $03
  169. atHorizontalCenter                EQU        $04
  170. atAbsoluteCenter                EQU        $05
  171. atCenterTop                        EQU        $06
  172. atCenterBottom                    EQU        $07
  173. atLeft                            EQU        $08
  174. atCenterLeft                    EQU        $09
  175. atTopLeft                        EQU        $0A
  176. atBottomLeft                    EQU        $0B
  177. atRight                            EQU        $0C
  178. atCenterRight                    EQU        $0D
  179. atTopRight                        EQU        $0E
  180. atBottomRight                    EQU        $0F
  181. ; typedef SInt16                         IconAlignmentType
  182.  
  183. ;  Transform type values. 
  184.  
  185. kTransformNone                    EQU        $00
  186. kTransformDisabled                EQU        $01
  187. kTransformOffline                EQU        $02
  188. kTransformOpen                    EQU        $03
  189. kTransformLabel1                EQU        $0100
  190. kTransformLabel2                EQU        $0200
  191. kTransformLabel3                EQU        $0300
  192. kTransformLabel4                EQU        $0400
  193. kTransformLabel5                EQU        $0500
  194. kTransformLabel6                EQU        $0600
  195. kTransformLabel7                EQU        $0700
  196. kTransformSelected                EQU        $4000
  197. kTransformSelectedDisabled        EQU        $4001
  198. kTransformSelectedOffline        EQU        $4002
  199. kTransformSelectedOpen            EQU        $4003
  200. ;  Obsolete. Use names defined above. 
  201.  
  202. ttNone                            EQU        $00
  203. ttDisabled                        EQU        $01
  204. ttOffline                        EQU        $02
  205. ttOpen                            EQU        $03
  206. ttLabel1                        EQU        $0100
  207. ttLabel2                        EQU        $0200
  208. ttLabel3                        EQU        $0300
  209. ttLabel4                        EQU        $0400
  210. ttLabel5                        EQU        $0500
  211. ttLabel6                        EQU        $0600
  212. ttLabel7                        EQU        $0700
  213. ttSelected                        EQU        $4000
  214. ttSelectedDisabled                EQU        $4001
  215. ttSelectedOffline                EQU        $4002
  216. ttSelectedOpen                    EQU        $4003
  217. ; typedef SInt16                         IconTransformType
  218.  
  219. ;  Selector mask values. 
  220.  
  221. kSelectorLarge1Bit                EQU        $00000001
  222. kSelectorLarge4Bit                EQU        $00000002
  223. kSelectorLarge8Bit                EQU        $00000004
  224. kSelectorLarge32Bit                EQU        $00000008
  225. kSelectorLarge8BitMask            EQU        $00000010
  226. kSelectorSmall1Bit                EQU        $00000100
  227. kSelectorSmall4Bit                EQU        $00000200
  228. kSelectorSmall8Bit                EQU        $00000400
  229. kSelectorSmall32Bit                EQU        $00000800
  230. kSelectorSmall8BitMask            EQU        $00001000
  231. kSelectorMini1Bit                EQU        $00010000
  232. kSelectorMini4Bit                EQU        $00020000
  233. kSelectorMini8Bit                EQU        $00040000
  234. kSelectorHuge1Bit                EQU        $01000000
  235. kSelectorHuge4Bit                EQU        $02000000
  236. kSelectorHuge8Bit                EQU        $04000000
  237. kSelectorHuge32Bit                EQU        $08000000
  238. kSelectorHuge8BitMask            EQU        $10000000
  239. kSelectorAllLargeData            EQU        $000000FF
  240. kSelectorAllSmallData            EQU        $0000FF00
  241. kSelectorAllMiniData            EQU        $00FF0000
  242. kSelectorAllHugeData            EQU        $FF000000
  243. kSelectorAll1BitData            EQU        $01010101
  244. kSelectorAll4BitData            EQU        $02020202
  245. kSelectorAll8BitData            EQU        $04040404
  246. kSelectorAll32BitData            EQU        $08000808
  247. kSelectorAllAvailableData        EQU        $FFFFFFFF
  248.  
  249. ;  Obsolete. Use names defined above. 
  250.  
  251. svLarge1Bit                        EQU        $00000001
  252. svLarge4Bit                        EQU        $00000002
  253. svLarge8Bit                        EQU        $00000004
  254. svSmall1Bit                        EQU        $00000100
  255. svSmall4Bit                        EQU        $00000200
  256. svSmall8Bit                        EQU        $00000400
  257. svMini1Bit                        EQU        $00010000
  258. svMini4Bit                        EQU        $00020000
  259. svMini8Bit                        EQU        $00040000
  260. svAllLargeData                    EQU        $000000FF
  261. svAllSmallData                    EQU        $0000FF00
  262. svAllMiniData                    EQU        $00FF0000
  263. svAll1BitData                    EQU        $01010101
  264. svAll4BitData                    EQU        $02020202
  265. svAll8BitData                    EQU        $04040404
  266. svAllAvailableData                EQU        $FFFFFFFF
  267. ; typedef UInt32                         IconSelectorValue
  268.  
  269. ; typedef IconActionProcPtr             IconAction
  270.  
  271. ; typedef IconGetterProcPtr             IconGetter
  272.  
  273.     IF ¬ OLDROUTINELOCATIONS THEN
  274. CIcon                    RECORD 0
  275. iconPMap                 ds        PixMap            ; offset: $0 (0)        ; the icon's pixMap
  276. iconMask                 ds        BitMap            ; offset: $32 (50)        ; the icon's mask
  277. iconBMap                 ds        BitMap            ; offset: $40 (64)        ; the icon's bitMap
  278. iconData                 ds.l    1                ; offset: $4E (78)        ; the icon's data
  279. iconMaskData             ds.w    1                ; offset: $52 (82) <-- really an array of length one ; icon's mask and BitMap data
  280. sizeof                     EQU *                    ; size:   $54 (84)
  281.                         ENDR
  282. ; typedef struct CIcon *                CIconPtr
  283.  
  284. ; typedef CIconPtr *                    CIconHandle
  285.  
  286. ;
  287. ; pascal CIconHandle GetCIcon(SInt16 iconID)
  288. ;
  289.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  290.         _GetCIcon:    OPWORD    $AA1E
  291.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  292.         IMPORT_CFM_FUNCTION GetCIcon
  293.     ENDIF
  294.  
  295. ;
  296. ; pascal void PlotCIcon(const Rect *theRect, CIconHandle theIcon)
  297. ;
  298.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  299.         _PlotCIcon:    OPWORD    $AA1F
  300.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  301.         IMPORT_CFM_FUNCTION PlotCIcon
  302.     ENDIF
  303.  
  304. ;
  305. ; pascal void DisposeCIcon(CIconHandle theIcon)
  306. ;
  307.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  308.         _DisposeCIcon:    OPWORD    $AA25
  309.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  310.         IMPORT_CFM_FUNCTION DisposeCIcon
  311.     ENDIF
  312.  
  313.     ENDIF
  314. ;
  315. ; pascal Handle GetIcon(SInt16 iconID)
  316. ;
  317.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  318.         _GetIcon:    OPWORD    $A9BB
  319.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  320.         IMPORT_CFM_FUNCTION GetIcon
  321.     ENDIF
  322.  
  323. ;
  324. ; pascal void PlotIcon(const Rect *theRect, Handle theIcon)
  325. ;
  326.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  327.         _PlotIcon:    OPWORD    $A94B
  328.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  329.         IMPORT_CFM_FUNCTION PlotIcon
  330.     ENDIF
  331.  
  332.  
  333.  
  334. ;    Note:    IconSuiteRef and IconCacheRef should be an abstract types, 
  335. ;            but too much source code already relies on them being of type Handle.
  336. ;
  337.  
  338. ; typedef Handle                         IconSuiteRef
  339.  
  340. ; typedef Handle                         IconCacheRef
  341.  
  342. ;  IconRefs are 32-bit values identifying cached icon data. IconRef 0 is invalid.
  343.  
  344.  
  345. ;
  346. ; pascal OSErr PlotIconID(const Rect *theRect, IconAlignmentType align, IconTransformType transform, SInt16 theResID)
  347. ;
  348.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  349.         Macro
  350.         _PlotIconID
  351.             move.w              #$0500,D0
  352.             dc.w                $ABC9
  353.         EndM
  354.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  355.         IMPORT_CFM_FUNCTION PlotIconID
  356.     ENDIF
  357.  
  358. ;
  359. ; pascal OSErr NewIconSuite(IconSuiteRef *theIconSuite)
  360. ;
  361.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  362.         Macro
  363.         _NewIconSuite
  364.             move.w              #$0207,D0
  365.             dc.w                $ABC9
  366.         EndM
  367.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  368.         IMPORT_CFM_FUNCTION NewIconSuite
  369.     ENDIF
  370.  
  371. ;
  372. ; pascal OSErr AddIconToSuite(Handle theIconData, IconSuiteRef theSuite, ResType theType)
  373. ;
  374.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  375.         Macro
  376.         _AddIconToSuite
  377.             move.w              #$0608,D0
  378.             dc.w                $ABC9
  379.         EndM
  380.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  381.         IMPORT_CFM_FUNCTION AddIconToSuite
  382.     ENDIF
  383.  
  384. ;
  385. ; pascal OSErr GetIconFromSuite(Handle *theIconData, IconSuiteRef theSuite, ResType theType)
  386. ;
  387.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  388.         Macro
  389.         _GetIconFromSuite
  390.             move.w              #$0609,D0
  391.             dc.w                $ABC9
  392.         EndM
  393.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  394.         IMPORT_CFM_FUNCTION GetIconFromSuite
  395.     ENDIF
  396.  
  397. ;
  398. ; pascal OSErr ForEachIconDo(IconSuiteRef theSuite, IconSelectorValue selector, IconActionUPP action, void *yourDataPtr)
  399. ;
  400.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  401.         Macro
  402.         _ForEachIconDo
  403.             move.w              #$080A,D0
  404.             dc.w                $ABC9
  405.         EndM
  406.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  407.         IMPORT_CFM_FUNCTION ForEachIconDo
  408.     ENDIF
  409.  
  410. ;
  411. ; pascal OSErr GetIconSuite(IconSuiteRef *theIconSuite, SInt16 theResID, IconSelectorValue selector)
  412. ;
  413.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  414.         Macro
  415.         _GetIconSuite
  416.             move.w              #$0501,D0
  417.             dc.w                $ABC9
  418.         EndM
  419.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  420.         IMPORT_CFM_FUNCTION GetIconSuite
  421.     ENDIF
  422.  
  423. ;
  424. ; pascal OSErr DisposeIconSuite(IconSuiteRef theIconSuite, Boolean disposeData)
  425. ;
  426.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  427.         Macro
  428.         _DisposeIconSuite
  429.             move.w              #$0302,D0
  430.             dc.w                $ABC9
  431.         EndM
  432.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  433.         IMPORT_CFM_FUNCTION DisposeIconSuite
  434.     ENDIF
  435.  
  436. ;
  437. ; pascal OSErr PlotIconSuite(const Rect *theRect, IconAlignmentType align, IconTransformType transform, IconSuiteRef theIconSuite)
  438. ;
  439.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  440.         Macro
  441.         _PlotIconSuite
  442.             move.w              #$0603,D0
  443.             dc.w                $ABC9
  444.         EndM
  445.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  446.         IMPORT_CFM_FUNCTION PlotIconSuite
  447.     ENDIF
  448.  
  449. ;
  450. ; pascal OSErr MakeIconCache(IconCacheRef *theCache, IconGetterUPP makeIcon, void *yourDataPtr)
  451. ;
  452.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  453.         Macro
  454.         _MakeIconCache
  455.             move.w              #$0604,D0
  456.             dc.w                $ABC9
  457.         EndM
  458.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  459.         IMPORT_CFM_FUNCTION MakeIconCache
  460.     ENDIF
  461.  
  462. ;
  463. ; pascal OSErr LoadIconCache(const Rect *theRect, IconAlignmentType align, IconTransformType transform, IconCacheRef theIconCache)
  464. ;
  465.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  466.         Macro
  467.         _LoadIconCache
  468.             move.w              #$0606,D0
  469.             dc.w                $ABC9
  470.         EndM
  471.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  472.         IMPORT_CFM_FUNCTION LoadIconCache
  473.     ENDIF
  474.  
  475. ;
  476. ; pascal OSErr PlotIconMethod(const Rect *theRect, IconAlignmentType align, IconTransformType transform, IconGetterUPP theMethod, void *yourDataPtr)
  477. ;
  478.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  479.         Macro
  480.         _PlotIconMethod
  481.             move.w              #$0805,D0
  482.             dc.w                $ABC9
  483.         EndM
  484.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  485.         IMPORT_CFM_FUNCTION PlotIconMethod
  486.     ENDIF
  487.  
  488. ;
  489. ; pascal OSErr GetLabel(SInt16 labelNumber, RGBColor *labelColor, Str255 labelString)
  490. ;
  491.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  492.         Macro
  493.         _GetLabel
  494.             move.w              #$050B,D0
  495.             dc.w                $ABC9
  496.         EndM
  497.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  498.         IMPORT_CFM_FUNCTION GetLabel
  499.     ENDIF
  500.  
  501. ;
  502. ; pascal Boolean PtInIconID(Point testPt, const Rect *iconRect, IconAlignmentType align, SInt16 iconID)
  503. ;
  504.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  505.         Macro
  506.         _PtInIconID
  507.             move.w              #$060D,D0
  508.             dc.w                $ABC9
  509.         EndM
  510.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  511.         IMPORT_CFM_FUNCTION PtInIconID
  512.     ENDIF
  513.  
  514. ;
  515. ; pascal Boolean PtInIconSuite(Point testPt, const Rect *iconRect, IconAlignmentType align, IconSuiteRef theIconSuite)
  516. ;
  517.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  518.         Macro
  519.         _PtInIconSuite
  520.             move.w              #$070E,D0
  521.             dc.w                $ABC9
  522.         EndM
  523.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  524.         IMPORT_CFM_FUNCTION PtInIconSuite
  525.     ENDIF
  526.  
  527. ;
  528. ; pascal Boolean PtInIconMethod(Point testPt, const Rect *iconRect, IconAlignmentType align, IconGetterUPP theMethod, void *yourDataPtr)
  529. ;
  530.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  531.         Macro
  532.         _PtInIconMethod
  533.             move.w              #$090F,D0
  534.             dc.w                $ABC9
  535.         EndM
  536.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  537.         IMPORT_CFM_FUNCTION PtInIconMethod
  538.     ENDIF
  539.  
  540. ;
  541. ; pascal Boolean RectInIconID(const Rect *testRect, const Rect *iconRect, IconAlignmentType align, SInt16 iconID)
  542. ;
  543.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  544.         Macro
  545.         _RectInIconID
  546.             move.w              #$0610,D0
  547.             dc.w                $ABC9
  548.         EndM
  549.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  550.         IMPORT_CFM_FUNCTION RectInIconID
  551.     ENDIF
  552.  
  553. ;
  554. ; pascal Boolean RectInIconSuite(const Rect *testRect, const Rect *iconRect, IconAlignmentType align, IconSuiteRef theIconSuite)
  555. ;
  556.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  557.         Macro
  558.         _RectInIconSuite
  559.             move.w              #$0711,D0
  560.             dc.w                $ABC9
  561.         EndM
  562.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  563.         IMPORT_CFM_FUNCTION RectInIconSuite
  564.     ENDIF
  565.  
  566. ;
  567. ; pascal Boolean RectInIconMethod(const Rect *testRect, const Rect *iconRect, IconAlignmentType align, IconGetterUPP theMethod, void *yourDataPtr)
  568. ;
  569.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  570.         Macro
  571.         _RectInIconMethod
  572.             move.w              #$0912,D0
  573.             dc.w                $ABC9
  574.         EndM
  575.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  576.         IMPORT_CFM_FUNCTION RectInIconMethod
  577.     ENDIF
  578.  
  579. ;
  580. ; pascal OSErr IconIDToRgn(RgnHandle theRgn, const Rect *iconRect, IconAlignmentType align, SInt16 iconID)
  581. ;
  582.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  583.         Macro
  584.         _IconIDToRgn
  585.             move.w              #$0613,D0
  586.             dc.w                $ABC9
  587.         EndM
  588.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  589.         IMPORT_CFM_FUNCTION IconIDToRgn
  590.     ENDIF
  591.  
  592. ;
  593. ; pascal OSErr IconSuiteToRgn(RgnHandle theRgn, const Rect *iconRect, IconAlignmentType align, IconSuiteRef theIconSuite)
  594. ;
  595.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  596.         Macro
  597.         _IconSuiteToRgn
  598.             move.w              #$0714,D0
  599.             dc.w                $ABC9
  600.         EndM
  601.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  602.         IMPORT_CFM_FUNCTION IconSuiteToRgn
  603.     ENDIF
  604.  
  605. ;
  606. ; pascal OSErr IconMethodToRgn(RgnHandle theRgn, const Rect *iconRect, IconAlignmentType align, IconGetterUPP theMethod, void *yourDataPtr)
  607. ;
  608.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  609.         Macro
  610.         _IconMethodToRgn
  611.             move.w              #$0915,D0
  612.             dc.w                $ABC9
  613.         EndM
  614.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  615.         IMPORT_CFM_FUNCTION IconMethodToRgn
  616.     ENDIF
  617.  
  618. ;
  619. ; pascal OSErr SetSuiteLabel(IconSuiteRef theSuite, SInt16 theLabel)
  620. ;
  621.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  622.         Macro
  623.         _SetSuiteLabel
  624.             move.w              #$0316,D0
  625.             dc.w                $ABC9
  626.         EndM
  627.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  628.         IMPORT_CFM_FUNCTION SetSuiteLabel
  629.     ENDIF
  630.  
  631. ;
  632. ; pascal SInt16 GetSuiteLabel(IconSuiteRef theSuite)
  633. ;
  634.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  635.         Macro
  636.         _GetSuiteLabel
  637.             move.w              #$0217,D0
  638.             dc.w                $ABC9
  639.         EndM
  640.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  641.         IMPORT_CFM_FUNCTION GetSuiteLabel
  642.     ENDIF
  643.  
  644. ;
  645. ; pascal OSErr GetIconCacheData(IconCacheRef theCache, void **theData)
  646. ;
  647.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  648.         Macro
  649.         _GetIconCacheData
  650.             move.w              #$0419,D0
  651.             dc.w                $ABC9
  652.         EndM
  653.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  654.         IMPORT_CFM_FUNCTION GetIconCacheData
  655.     ENDIF
  656.  
  657. ;
  658. ; pascal OSErr SetIconCacheData(IconCacheRef theCache, void *theData)
  659. ;
  660.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  661.         Macro
  662.         _SetIconCacheData
  663.             move.w              #$041A,D0
  664.             dc.w                $ABC9
  665.         EndM
  666.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  667.         IMPORT_CFM_FUNCTION SetIconCacheData
  668.     ENDIF
  669.  
  670. ;
  671. ; pascal OSErr GetIconCacheProc(IconCacheRef theCache, IconGetterUPP *theProc)
  672. ;
  673.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  674.         Macro
  675.         _GetIconCacheProc
  676.             move.w              #$041B,D0
  677.             dc.w                $ABC9
  678.         EndM
  679.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  680.         IMPORT_CFM_FUNCTION GetIconCacheProc
  681.     ENDIF
  682.  
  683. ;
  684. ; pascal OSErr SetIconCacheProc(IconCacheRef theCache, IconGetterUPP theProc)
  685. ;
  686.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  687.         Macro
  688.         _SetIconCacheProc
  689.             move.w              #$041C,D0
  690.             dc.w                $ABC9
  691.         EndM
  692.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  693.         IMPORT_CFM_FUNCTION SetIconCacheProc
  694.     ENDIF
  695.  
  696. ;
  697. ; pascal OSErr PlotIconHandle(const Rect *theRect, IconAlignmentType align, IconTransformType transform, Handle theIcon)
  698. ;
  699.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  700.         Macro
  701.         _PlotIconHandle
  702.             move.w              #$061D,D0
  703.             dc.w                $ABC9
  704.         EndM
  705.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  706.         IMPORT_CFM_FUNCTION PlotIconHandle
  707.     ENDIF
  708.  
  709. ;
  710. ; pascal OSErr PlotSICNHandle(const Rect *theRect, IconAlignmentType align, IconTransformType transform, Handle theSICN)
  711. ;
  712.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  713.         Macro
  714.         _PlotSICNHandle
  715.             move.w              #$061E,D0
  716.             dc.w                $ABC9
  717.         EndM
  718.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  719.         IMPORT_CFM_FUNCTION PlotSICNHandle
  720.     ENDIF
  721.  
  722. ;
  723. ; pascal OSErr PlotCIconHandle(const Rect *theRect, IconAlignmentType align, IconTransformType transform, CIconHandle theCIcon)
  724. ;
  725.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  726.         Macro
  727.         _PlotCIconHandle
  728.             move.w              #$061F,D0
  729.             dc.w                $ABC9
  730.         EndM
  731.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  732.         IMPORT_CFM_FUNCTION PlotCIconHandle
  733.     ENDIF
  734.  
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746. ;   IconServices is an efficient mechanism to share icon data amongst multiple 
  747. ;   clients. It avoids duplication of data; it provides efficient caching, 
  748. ;   releasing memory when the icon data is no longer needed; it can provide
  749. ;   the appropriate icon for any filesystem object; it can provide commonly 
  750. ;   used icons (caution, note, help...); it is Appearance-savvy: the icons
  751. ;   are switched when appropriate.
  752. ;   To refer to a cached icon data, IconServices uses IconRef, a 32-bit
  753. ;   opaque value. IconRefs are reference counted. When there are no more clients 
  754. ;   for an IconRef, the bitmap memory associated with it is marked as disposeable. 
  755. ;   Two files of same type and creator with no custom icon will have the same IconRef.
  756. ;   Files with custom icons will have their own IconRef.
  757.  
  758.  
  759.  
  760.  
  761. ;   Use the special creator kSystemIconsCreator to get "standard" icons 
  762. ;   that are not associated with a file, such as the help icon.
  763.  
  764.  
  765.  
  766. kSystemIconsCreator                EQU        'macs'
  767.  
  768.  
  769. ;   Type of the predefined/generic icons. For example, the call:
  770. ;   GetIconRef(kOnSystemDisk, kSystemIconsCreator, kHelpIcon, &iconRef);
  771. ;   will retun in iconRef the IconRef for the standard help icon.
  772.  
  773.  
  774.  
  775. ;  Generic Finder icons 
  776.  
  777. kClipboardIcon                    EQU        'CLIP'
  778. kClippingUnknownTypeIcon        EQU        'clpu'
  779. kClippingPictureTypeIcon        EQU        'clpp'
  780. kClippingTextTypeIcon            EQU        'clpt'
  781. kClippingSoundTypeIcon            EQU        'clps'
  782. kDesktopIcon                    EQU        'desk'
  783. kFinderIcon                        EQU        'FNDR'
  784. kFontSuitcaseIcon                EQU        'FFIL'
  785. kFullTrashIcon                    EQU        'ftrh'
  786. kGenericApplicationIcon            EQU        'APPL'
  787. kGenericCDROMIcon                EQU        'cddr'
  788. kGenericControlPanelIcon        EQU        'APPC'
  789. kGenericControlStripModuleIcon    EQU        'sdev'
  790. kGenericComponentIcon            EQU        'thng'
  791. kGenericDeskAccessoryIcon        EQU        'APPD'
  792. kGenericDocumentIcon            EQU        'docu'
  793. kGenericEditionFileIcon            EQU        'edtf'
  794. kGenericExtensionIcon            EQU        'INIT'
  795. kGenericFileServerIcon            EQU        'srvr'
  796. kGenericFontIcon                EQU        'ffil'
  797. kGenericFontScalerIcon            EQU        'sclr'
  798. kGenericFloppyIcon                EQU        'flpy'
  799. kGenericHardDiskIcon            EQU        'hdsk'
  800. kGenericRemovableMediaIcon        EQU        'rmov'
  801. kGenericMoverObjectIcon            EQU        'movr'
  802. kGenericPCCardIcon                EQU        'pcmc'
  803. kGenericPreferencesIcon            EQU        'pref'
  804. kGenericQueryDocumentIcon        EQU        'qery'
  805. kGenericRAMDiskIcon                EQU        'ramd'
  806. kGenericSharedLibaryIcon        EQU        'shlb'
  807. kGenericStationeryIcon            EQU        'sdoc'
  808. kGenericSuitcaseIcon            EQU        'suit'
  809. kGenericWORMIcon                EQU        'worm'
  810. kInternationResourcesIcon        EQU        'ifil'
  811. kKeyboardLayoutIcon                EQU        'kfil'
  812. kSoundFileIcon                    EQU        'sfil'
  813. kSystemSuitcaseIcon                EQU        'zsys'
  814. kTrashIcon                        EQU        'trsh'
  815. kTrueTypeFontIcon                EQU        'tfil'
  816. kTrueTypeFlatFontIcon            EQU        'sfnt'
  817. kTrueTypeMultiFlatFontIcon        EQU        'ttcf'
  818. ;  Internet locations 
  819.  
  820. kInternetLocationHTTPIcon        EQU        'ilht'
  821. kInternetLocationFTPIcon        EQU        'ilft'
  822. kInternetLocationAppleShareIcon    EQU        'ilaf'
  823. kInternetLocationAppleTalkZoneIcon EQU    'ilat'
  824. kInternetLocationFileIcon        EQU        'ilfi'
  825. kInternetLocationMailIcon        EQU        'ilma'
  826. kInternetLocationNewsIcon        EQU        'ilnw'
  827. kInternetLocationGenericIcon    EQU        'ilge'
  828. ;  Folders 
  829.  
  830. kGenericFolderIcon                EQU        'fldr'
  831. kDropFolderIcon                    EQU        'dbox'
  832. kMountedFolderIcon                EQU        'mntd'
  833. kOpenFolderIcon                    EQU        'ofld'
  834. kOwnedFolderIcon                EQU        'ownd'
  835. kPrivateFolderIcon                EQU        'prvf'
  836. kSharedFolderIcon                EQU        'shfl'
  837. ;  Sharing Privileges icons 
  838.  
  839. kSharingPrivsNotApplicableIcon    EQU        'shna'
  840. kSharingPrivsReadOnlyIcon        EQU        'shro'
  841. kSharingPrivsReadWriteIcon        EQU        'shrw'
  842. kSharingPrivsUnknownIcon        EQU        'shuk'
  843. kSharingPrivsWritableIcon        EQU        'writ'
  844.  
  845. ;  Users and Groups icons 
  846.  
  847. kUserFolderIcon                    EQU        'ufld'
  848. kWorkgroupFolderIcon            EQU        'wfld'
  849. kGuestUserIcon                    EQU        'gusr'
  850. kUserIcon                        EQU        'user'
  851. kOwnerIcon                        EQU        'susr'
  852. kGroupIcon                        EQU        'grup'
  853. ;  Special folders 
  854.  
  855. kAppleExtrasFolderIcon            EQU        'aexƒ'
  856. kAppleMenuFolderIcon            EQU        'amnu'
  857. kApplicationsFolderIcon            EQU        'apps'
  858. kApplicationSupportFolderIcon    EQU        'asup'
  859. kAssistantsFolderIcon            EQU        'astƒ'
  860. kContextualMenuItemsFolderIcon    EQU        'cmnu'
  861. kControlPanelDisabledFolderIcon    EQU        'ctrD'
  862. kControlPanelFolderIcon            EQU        'ctrl'
  863. kControlStripModulesFolderIcon    EQU        'sdvƒ'
  864. kDocumentsFolderIcon            EQU        'docs'
  865. kExtensionsDisabledFolderIcon    EQU        'extD'
  866. kExtensionsFolderIcon            EQU        'extn'
  867. kFavoritesFolderIcon            EQU        'favs'
  868. kFontsFolderIcon                EQU        'font'
  869. kHelpFolderIcon                    EQU        'ƒhlp'
  870. kInternetFolderIcon                EQU        'intƒ'
  871. kInternetPlugInFolderIcon        EQU        'ƒnet'
  872. kMacOSReadMeFolderIcon            EQU        'morƒ'
  873. kPreferencesFolderIcon            EQU        'prfƒ'
  874. kPrinterDescriptionFolderIcon    EQU        'ppdf'
  875. kPrinterDriverFolderIcon        EQU        'ƒprd'
  876. kPrintMonitorFolderIcon            EQU        'prnt'
  877. kRecentApplicationsFolderIcon    EQU        'rapp'
  878. kRecentDocumentsFolderIcon        EQU        'rdoc'
  879. kRecentServersFolderIcon        EQU        'rsrv'
  880. kScriptingAdditionsFolderIcon    EQU        'ƒscr'
  881. kSharedLibrariesFolderIcon        EQU        'ƒlib'
  882. kScriptsFolderIcon                EQU        'scrƒ'
  883. kShutdownItemsDisabledFolderIcon EQU    'shdD'
  884. kShutdownItemsFolderIcon        EQU        'shdf'
  885. kSpeakableItemsFolder            EQU        'spki'
  886. kStartupItemsDisabledFolderIcon    EQU        'strD'
  887. kStartupItemsFolderIcon            EQU        'strt'
  888. kSystemExtensionDisabledFolderIcon EQU    'macD'
  889. kSystemFolderIcon                EQU        'macs'
  890. kTextEncodingsFolderIcon        EQU        'ƒtex'
  891. kAppearanceFolderIcon            EQU        'appr'
  892. kUtilitiesFolderIcon            EQU        'utiƒ'
  893. kVoicesFolderIcon                EQU        'fvoc'
  894. kColorSyncFolderIcon            EQU        'prof'
  895. kInternetSearchSitesFolderIcon    EQU        'issf'
  896. ;  Badges 
  897.  
  898. kAppleScriptBadgeIcon            EQU        'scrp'
  899. kLockedBadgeIcon                EQU        'lbdg'
  900. kMountedBadgeIcon                EQU        'mbdg'
  901. kSharedBadgeIcon                EQU        'sbdg'
  902. kAliasBadgeIcon                    EQU        'abdg'
  903. ;  Alert icons 
  904.  
  905. kAlertNoteIcon                    EQU        'note'
  906. kAlertCautionIcon                EQU        'caut'
  907. kAlertStopIcon                    EQU        'stop'
  908. ;  Networking icons 
  909.  
  910. kAppleTalkIcon                    EQU        'atlk'
  911. kAppleTalkZoneIcon                EQU        'atzn'
  912. kAFPServerIcon                    EQU        'afps'
  913. kFTPServerIcon                    EQU        'ftps'
  914. kIPFileServerIcon                EQU        'isrv'
  915. ;  Other icons 
  916.  
  917. kAppleLogoIcon                    EQU        'capl'
  918. kAppleMenuIcon                    EQU        'sapl'
  919. kBackwardArrowIcon                EQU        'baro'
  920. kFavoriteItemsIcon                EQU        'favr'
  921. kForwardArrowIcon                EQU        'faro'
  922. kGridIcon                        EQU        'grid'
  923. kHelpIcon                        EQU        'help'
  924. kKeepArrangedIcon                EQU        'arng'
  925. kLockedIcon                        EQU        'lock'
  926. kNoFilesIcon                    EQU        'nfil'
  927. kNoFolderIcon                    EQU        'nfld'
  928. kNoWriteIcon                    EQU        'nwrt'
  929. kProtectedApplicationFolderIcon    EQU        'papp'
  930. kProtectedSystemFolderIcon        EQU        'psys'
  931. kRecentItemsIcon                EQU        'rcnt'
  932. kShortcutIcon                    EQU        'shrt'
  933. kSortAscendingIcon                EQU        'asnd'
  934. kSortDescendingIcon                EQU        'dsnd'
  935. kUnlockedIcon                    EQU        'ulck'
  936. kConnectToIcon                    EQU        'cnct'
  937.  
  938. ;     Error codes range from -2580 to -2599 
  939.  
  940. invalidIconRefErr                EQU        -2580
  941. noSuchIconErr                    EQU        -2581
  942. noIconDataAvailableErr            EQU        -2582
  943.  
  944. ;     IconServicesUsageFlags 
  945. ; typedef UInt32                         IconServicesUsageFlags
  946.  
  947.  
  948. kIconServicesNormalUsageFlag    EQU        0
  949.  
  950.  
  951. ;      IconFamily 'icns' resources contain an entire IconFamily (all sizes and depths).  
  952. ;   For custom icons, icns IconFamily resources of the custom icon resource ID are fetched first before
  953. ;   the classic custom icons (individual 'ics#, ICN#, etc) are fetched.  If the fetch of the icns resource
  954. ;   succeeds then the icns is looked at exclusively for the icon data.
  955. ;   For custom icons, new icon features such as 32-bit deep icons are only fetched from the icns resource.
  956. ;   This is to avoid incompatibilities with cut & paste of new style icons with an older version of the
  957. ;   MacOS Finder.
  958. ;   DriverGestalt is called with code kdgMediaIconSuite by IconServices after calling FSM to determine a
  959. ;   driver icon for a particular device.  The result of the kdgMediaIconSuite call to DriverGestalt should
  960. ;   be a pointer an an IconFamily.  In this manner driver vendors can provide rich, detailed drive icons
  961. ;   instead of the 1-bit variety previously supported.
  962.  
  963.  
  964.  
  965. kIconFamilyType                    EQU        'icns'
  966.  
  967. IconFamilyElement        RECORD 0
  968. elementType                 ds.l    1                ; offset: $0 (0)        ;  'ICN#', 'icl8', etc...
  969. elementSize                 ds.l    1                ; offset: $4 (4)        ;  Size of this element
  970. elementData                 ds.b    1                ; offset: $8 (8) <-- really an array of length one
  971.                          ORG 10
  972. sizeof                     EQU *                    ; size:   $A (10)
  973.                         ENDR
  974. IconFamilyResource        RECORD 0
  975. resourceType             ds.l    1                ; offset: $0 (0)        ;  Always 'icns'
  976. resourceSize             ds.l    1                ; offset: $4 (4)        ;  Total size of this resource
  977. elements                 ds        IconFamilyElement ; offset: $8 (8) <-- really an array of length one
  978. sizeof                     EQU *                    ; size:   $12 (18)
  979.                         ENDR
  980. ; typedef struct IconFamilyResource *    IconFamilyPtr
  981.  
  982. ; typedef IconFamilyPtr *                IconFamilyHandle
  983.  
  984.  
  985.  
  986. ;  ==============================================================================
  987. ;   Initialization and Termination
  988. ;  ==============================================================================
  989.  
  990.  
  991.  
  992.  
  993.  
  994. ;   IconServicesInit
  995. ;   
  996. ;   Call this routine once per classic 68K application initialization.
  997. ;   This routine does not need to be called at boot time.
  998.  
  999.  
  1000.  
  1001. ;
  1002. ; pascal OSErr IconServicesInit(CFragInitBlockPtr initBlockPtr)
  1003. ;
  1004.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1005.         Macro
  1006.         _IconServicesInit
  1007.             moveq               #21,D0
  1008.             dc.w                $AA75
  1009.         EndM
  1010.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1011.         IMPORT_CFM_FUNCTION IconServicesInit
  1012.     ENDIF
  1013.  
  1014.  
  1015.  
  1016. ;   IconServicesTerminate:
  1017. ;   
  1018. ;   Call this routine once from the termination of a classic 68K application.
  1019. ;   This routine does not need to be called at boot time.
  1020.  
  1021.  
  1022.  
  1023. ;
  1024. ; pascal void IconServicesTerminate(void )
  1025. ;
  1026.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1027.         Macro
  1028.         _IconServicesTerminate
  1029.             moveq               #22,D0
  1030.             dc.w                $AA75
  1031.         EndM
  1032.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1033.         IMPORT_CFM_FUNCTION IconServicesTerminate
  1034.     ENDIF
  1035.  
  1036.  
  1037.  
  1038.  
  1039. ;  ==============================================================================
  1040. ;   Converting data structures
  1041. ;  ==============================================================================
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047. ;   IconRefToIconFamily
  1048. ;   This routines returns a new IconFamily that contains the data corresponding
  1049. ;   to the specified IconRef
  1050.  
  1051.  
  1052.  
  1053. ;
  1054. ; pascal OSErr IconRefToIconFamily(IconRef theIconRef, IconSelectorValue whichIcons, IconFamilyHandle *iconFamily)
  1055. ;
  1056.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1057.         Macro
  1058.         _IconRefToIconFamily
  1059.             moveq               #36,D0
  1060.             dc.w                $AA75
  1061.         EndM
  1062.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1063.         IMPORT_CFM_FUNCTION IconRefToIconFamily
  1064.     ENDIF
  1065.  
  1066.  
  1067.  
  1068. ;   IconFamilyToIconSuite
  1069. ;   This routines transfers the data in an icon family into an icon suite.
  1070.  
  1071.  
  1072.  
  1073. ;
  1074. ; pascal OSErr IconFamilyToIconSuite(IconFamilyHandle iconFamily, IconSelectorValue whichIcons, IconSuiteRef *iconSuite)
  1075. ;
  1076.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1077.         Macro
  1078.         _IconFamilyToIconSuite
  1079.             moveq               #37,D0
  1080.             dc.w                $AA75
  1081.         EndM
  1082.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1083.         IMPORT_CFM_FUNCTION IconFamilyToIconSuite
  1084.     ENDIF
  1085.  
  1086.  
  1087.  
  1088. ;   IconSuiteToIconFamily
  1089. ;   This routines transfers the data in an icon suite into an icon family.
  1090.  
  1091.  
  1092.  
  1093. ;
  1094. ; pascal OSErr IconSuiteToIconFamily(IconSuiteRef iconSuite, IconSelectorValue whichIcons, IconFamilyHandle *iconFamily)
  1095. ;
  1096.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1097.         Macro
  1098.         _IconSuiteToIconFamily
  1099.             moveq               #38,D0
  1100.             dc.w                $AA75
  1101.         EndM
  1102.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1103.         IMPORT_CFM_FUNCTION IconSuiteToIconFamily
  1104.     ENDIF
  1105.  
  1106.  
  1107.  
  1108. ;   SetIconFamilyData
  1109. ;   Change the data of an icon family. The data is copied.
  1110. ;   The type can be one of the icon type, or 'PICT'
  1111. ;   The data will be compressed if needed.
  1112.  
  1113.  
  1114.  
  1115. ;
  1116. ; pascal OSErr SetIconFamilyData(IconFamilyHandle iconFamily, OSType iconType, Handle h)
  1117. ;
  1118.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1119.         Macro
  1120.         _SetIconFamilyData
  1121.             moveq               #48,D0
  1122.             dc.w                $AA75
  1123.         EndM
  1124.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1125.         IMPORT_CFM_FUNCTION SetIconFamilyData
  1126.     ENDIF
  1127.  
  1128.  
  1129.  
  1130. ;   GetIconFamilyData
  1131. ;   Return a copy of the data in the icon family.
  1132. ;   The type can be one of the icon type, or 'PICT'
  1133. ;   The data will be returned uncompressed.
  1134.  
  1135.  
  1136.  
  1137. ;
  1138. ; pascal OSErr GetIconFamilyData(IconFamilyHandle iconFamily, OSType iconType, Handle h)
  1139. ;
  1140.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1141.         Macro
  1142.         _GetIconFamilyData
  1143.             moveq               #49,D0
  1144.             dc.w                $AA75
  1145.         EndM
  1146.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1147.         IMPORT_CFM_FUNCTION GetIconFamilyData
  1148.     ENDIF
  1149.  
  1150.  
  1151.  
  1152. ;  ==============================================================================
  1153. ;   Reference counting
  1154. ;  ==============================================================================
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160. ;   GetIconRefOwners
  1161. ;   
  1162. ;   This routine returns the reference count for the IconRef, or number of owners.
  1163. ;   
  1164. ;   A valid IconRef always has at least one owner.
  1165.  
  1166.  
  1167.  
  1168. ;
  1169. ; pascal OSErr GetIconRefOwners(IconRef theIconRef, UInt16 *owners)
  1170. ;
  1171.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1172.         Macro
  1173.         _GetIconRefOwners
  1174.             moveq               #11,D0
  1175.             dc.w                $AA75
  1176.         EndM
  1177.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1178.         IMPORT_CFM_FUNCTION GetIconRefOwners
  1179.     ENDIF
  1180.  
  1181.  
  1182.  
  1183. ;   AcquireIconRef
  1184. ;   This routine increments the reference count for the IconRef
  1185.  
  1186.  
  1187.  
  1188. ;
  1189. ; pascal OSErr AcquireIconRef(IconRef theIconRef)
  1190. ;
  1191.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1192.         Macro
  1193.         _AcquireIconRef
  1194.             moveq               #39,D0
  1195.             dc.w                $AA75
  1196.         EndM
  1197.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1198.         IMPORT_CFM_FUNCTION AcquireIconRef
  1199.     ENDIF
  1200.  
  1201.  
  1202.  
  1203.  
  1204. ;   ReleaseIconRef
  1205. ;   
  1206. ;   This routine decrements the reference count for the IconRef.
  1207. ;   
  1208. ;   When the reference count reaches 0, all memory allocated for the icon
  1209. ;   is disposed. Any subsequent use of the IconRef is invalid.
  1210.  
  1211.  
  1212.  
  1213. ;
  1214. ; pascal OSErr ReleaseIconRef(IconRef theIconRef)
  1215. ;
  1216.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1217.         Macro
  1218.         _ReleaseIconRef
  1219.             moveq               #40,D0
  1220.             dc.w                $AA75
  1221.         EndM
  1222.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1223.         IMPORT_CFM_FUNCTION ReleaseIconRef
  1224.     ENDIF
  1225.  
  1226.  
  1227.  
  1228.  
  1229. ;  ==============================================================================
  1230. ;   Getting an IconRef
  1231. ;  ==============================================================================
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237. ;   GetIconRefFromFile
  1238. ;   
  1239. ;   This routine returns an icon ref for the specified file, folder or volume.
  1240. ;   The label information is provided separately, since two files with the same icon 
  1241. ;   but a different label would share the same iconRef. The label can be used in 
  1242. ;   PlotIconRef() for example.
  1243. ;   
  1244. ;   Use this routine if you have no information about the file system object. If 
  1245. ;   you have already done a GetCatInfo on the file and want to save some I/O, 
  1246. ;   call GetIconRefFromFolder() if you know it's a folder with no custom icon or 
  1247. ;   call GetIconRef() if it's a file with no custom icon.
  1248. ;   This routine increments the reference count of the returned IconRef. Call 
  1249. ;   ReleaseIconRef() when you're done with it.
  1250.  
  1251.  
  1252.  
  1253. ;
  1254. ; pascal OSErr GetIconRefFromFile(const FSSpec *theFile, IconRef *theIconRef, SInt16 *theLabel)
  1255. ;
  1256.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1257.         Macro
  1258.         _GetIconRefFromFile
  1259.             moveq               #2,D0
  1260.             dc.w                $AA75
  1261.         EndM
  1262.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1263.         IMPORT_CFM_FUNCTION GetIconRefFromFile
  1264.     ENDIF
  1265.  
  1266.  
  1267.  
  1268.  
  1269. ;   GetIconRef
  1270. ;   
  1271. ;   This routine returns an icon ref for an icon in the desktop database or
  1272. ;   for a registered icon.
  1273. ;   The system registers a set of icon such as the help icon with the creator 
  1274. ;   code kSystemIconCreator. See above for a list of the registered system types.
  1275. ;   The vRefNum is used as a hint on where to look for the icon first. Use 
  1276. ;   kOnSystemDisk if you don't know what to pass.
  1277. ;   This routine increments the reference count of the returned IconRef. Call 
  1278. ;   ReleaseIconRef() when you're done with it.
  1279.  
  1280.  
  1281.  
  1282. ;
  1283. ; pascal OSErr GetIconRef(SInt16 vRefNum, OSType creator, OSType iconType, IconRef *theIconRef)
  1284. ;
  1285.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1286.         Macro
  1287.         _GetIconRef
  1288.             moveq               #33,D0
  1289.             dc.w                $AA75
  1290.         EndM
  1291.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1292.         IMPORT_CFM_FUNCTION GetIconRef
  1293.     ENDIF
  1294.  
  1295.  
  1296.  
  1297.  
  1298. ;   GetIconRefFromFolder
  1299. ;   
  1300. ;   This routine returns an icon ref for a folder with no custom icon.
  1301. ;   Use the more generic, but slightly slower, GetIconRefFromFile() if
  1302. ;   you don't already have the necessary info about the file.
  1303. ;   Attributes should be CInfoPBRec.dirInfo.ioFlAttrib for this folder.
  1304. ;   Access privileges should be CInfoPBRec.dirInfo.ioACUser for this folder.
  1305. ;   This routine increments the reference count of the IconRef. Call ReleaseIconRef() 
  1306. ;   when you're done with it.
  1307.  
  1308.  
  1309.  
  1310. ;
  1311. ; pascal OSErr GetIconRefFromFolder(SInt16 vRefNum, SInt32 parentFolderID, SInt32 folderID, SInt8 attributes, SInt8 accessPrivileges, IconRef *theIconRef)
  1312. ;
  1313.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1314.         Macro
  1315.         _GetIconRefFromFolder
  1316.             moveq               #34,D0
  1317.             dc.w                $AA75
  1318.         EndM
  1319.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1320.         IMPORT_CFM_FUNCTION GetIconRefFromFolder
  1321.     ENDIF
  1322.  
  1323.  
  1324.  
  1325.  
  1326. ;  ==============================================================================
  1327. ;   Adding and modifying IconRef
  1328. ;  ==============================================================================
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334. ;   RegisterIconRefFromIconFamily
  1335. ;   This routine adds a new entry to the IconRef registry. Other clients will be 
  1336. ;   able to access it using the (creator, iconType) pair specified here.
  1337. ;   Lower-case creators are reserved for the system.
  1338. ;   Consider using RegisterIconRefFromResource() if possible, since the data 
  1339. ;   registered using RegisterIconRefFromFamily() cannot be purged.
  1340. ;   The iconFamily data is copied and the caller is reponsible for disposing of it.
  1341. ;   This routine increments the reference count of the IconRef. Call ReleaseIconRef() 
  1342. ;   when you're done with it.
  1343.  
  1344.  
  1345.  
  1346. ;
  1347. ; pascal OSErr RegisterIconRefFromIconFamily(OSType creator, OSType iconType, IconFamilyHandle iconFamily, IconRef *theIconRef)
  1348. ;
  1349.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1350.         Macro
  1351.         _RegisterIconRefFromIconFamily
  1352.             moveq               #28,D0
  1353.             dc.w                $AA75
  1354.         EndM
  1355.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1356.         IMPORT_CFM_FUNCTION RegisterIconRefFromIconFamily
  1357.     ENDIF
  1358.  
  1359.  
  1360.  
  1361. ;   RegisterIconRefFromResource
  1362. ;   
  1363. ;   Registers an IconRef from a resouce file.  
  1364. ;   The icon data to be fetched is either classic icon data or an icon family.  
  1365. ;   The 'icns' icon family is searched for before the classic icon data.
  1366. ;   This routine increments the reference count of the IconRef. Call ReleaseIconRef() 
  1367. ;   when you're done with it.
  1368.  
  1369.  
  1370.  
  1371. ;
  1372. ; pascal OSErr RegisterIconRefFromResource(OSType creator, OSType iconType, const FSSpec *resourceFile, SInt16 resourceID, IconRef *theIconRef)
  1373. ;
  1374.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1375.         Macro
  1376.         _RegisterIconRefFromResource
  1377.             moveq               #35,D0
  1378.             dc.w                $AA75
  1379.         EndM
  1380.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1381.         IMPORT_CFM_FUNCTION RegisterIconRefFromResource
  1382.     ENDIF
  1383.  
  1384.  
  1385.  
  1386. ;   UnregisterIconRef
  1387. ;   
  1388. ;   Removes the specified icon from the icon cache (if there are no users of it).  
  1389. ;   If some clients are using this iconRef, then the IconRef will be removed when the 
  1390. ;   last user calls ReleaseIconRef.
  1391.  
  1392.  
  1393.  
  1394. ;
  1395. ; pascal OSErr UnregisterIconRef(OSType creator, OSType iconType)
  1396. ;
  1397.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1398.         Macro
  1399.         _UnregisterIconRef
  1400.             moveq               #8,D0
  1401.             dc.w                $AA75
  1402.         EndM
  1403.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1404.         IMPORT_CFM_FUNCTION UnregisterIconRef
  1405.     ENDIF
  1406.  
  1407.  
  1408.  
  1409.  
  1410. ;   UpdateIconRef
  1411. ;   
  1412. ;   Call this routine to force an update of the data for iconRef.
  1413. ;   
  1414. ;   For example after changing an icon in the desktop database or changing the custom 
  1415. ;   icon of a file. Note that after _adding_ a custom icon to file or folder, you 
  1416. ;   need to call GetIconRefFromFile() to get a new IconRef specific to this file. 
  1417. ;   
  1418. ;   This routine does nothing if the IconRef is a registered icon.
  1419.  
  1420.  
  1421.  
  1422. ;
  1423. ; pascal OSErr UpdateIconRef(IconRef theIconRef)
  1424. ;
  1425.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1426.         Macro
  1427.         _UpdateIconRef
  1428.             moveq               #9,D0
  1429.             dc.w                $AA75
  1430.         EndM
  1431.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1432.         IMPORT_CFM_FUNCTION UpdateIconRef
  1433.     ENDIF
  1434.  
  1435.  
  1436.  
  1437.  
  1438. ;   OverrideIconRefFromResource
  1439. ;   
  1440. ;   This routines replaces the bitmaps of the specified IconRef with the ones
  1441. ;   in the specified resource file.
  1442.  
  1443.  
  1444.  
  1445. ;
  1446. ; pascal OSErr OverrideIconRefFromResource(IconRef theIconRef, const FSSpec *resourceFile, SInt16 resourceID)
  1447. ;
  1448.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1449.         Macro
  1450.         _OverrideIconRefFromResource
  1451.             moveq               #42,D0
  1452.             dc.w                $AA75
  1453.         EndM
  1454.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1455.         IMPORT_CFM_FUNCTION OverrideIconRefFromResource
  1456.     ENDIF
  1457.  
  1458.  
  1459.  
  1460.  
  1461. ;   OverrideIconRef
  1462. ;   
  1463. ;   This routines replaces the bitmaps of the specified IconRef with the ones
  1464. ;   from the new IconRef.
  1465.  
  1466.  
  1467.  
  1468. ;
  1469. ; pascal OSErr OverrideIconRef(IconRef oldIconRef, IconRef newIconRef)
  1470. ;
  1471.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1472.         Macro
  1473.         _OverrideIconRef
  1474.             moveq               #43,D0
  1475.             dc.w                $AA75
  1476.         EndM
  1477.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1478.         IMPORT_CFM_FUNCTION OverrideIconRef
  1479.     ENDIF
  1480.  
  1481.  
  1482.  
  1483. ;   RemoveIconRefOverride
  1484. ;   This routine remove an override if one was applied to the icon and 
  1485. ;   reverts back to the original bitmap data.
  1486.  
  1487.  
  1488.  
  1489. ;
  1490. ; pascal OSErr RemoveIconRefOverride(IconRef theIconRef)
  1491. ;
  1492.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1493.         Macro
  1494.         _RemoveIconRefOverride
  1495.             moveq               #30,D0
  1496.             dc.w                $AA75
  1497.         EndM
  1498.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1499.         IMPORT_CFM_FUNCTION RemoveIconRefOverride
  1500.     ENDIF
  1501.  
  1502.  
  1503.  
  1504.  
  1505. ;  ==============================================================================
  1506. ;   Creating composite IconRef
  1507. ;  ==============================================================================
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513. ;   CompositeIconRef
  1514. ;   
  1515. ;   Superimposes an IconRef on top of another one
  1516.  
  1517.  
  1518.  
  1519. ;
  1520. ; pascal OSErr CompositeIconRef(IconRef backgroundIconRef, IconRef foregroundIconRef, IconRef *compositeIconRef)
  1521. ;
  1522.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1523.         Macro
  1524.         _CompositeIconRef
  1525.             moveq               #20,D0
  1526.             dc.w                $AA75
  1527.         EndM
  1528.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1529.         IMPORT_CFM_FUNCTION CompositeIconRef
  1530.     ENDIF
  1531.  
  1532.  
  1533.  
  1534. ;   IsIconRefComposite
  1535. ;   Indicates if a given icon ref is a composite of two other icon refs (and which ones)
  1536. ;   If it isn't a composite, backgroundIconRef and foreGroundIconRef will be 0.
  1537.  
  1538.  
  1539.  
  1540. ;
  1541. ; pascal OSErr IsIconRefComposite(IconRef compositeIconRef, IconRef *backgroundIconRef, IconRef *foregroundIconRef)
  1542. ;
  1543.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1544.         Macro
  1545.         _IsIconRefComposite
  1546.             moveq               #26,D0
  1547.             dc.w                $AA75
  1548.         EndM
  1549.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1550.         IMPORT_CFM_FUNCTION IsIconRefComposite
  1551.     ENDIF
  1552.  
  1553.  
  1554.  
  1555.  
  1556. ;  ==============================================================================
  1557. ;   Using IconRef
  1558. ;  ==============================================================================
  1559.  
  1560.  
  1561.  
  1562.  
  1563. ;   IsValidIconRef
  1564. ;   Return true if the iconRef passed in is a valid icon ref
  1565.  
  1566.  
  1567.  
  1568. ;
  1569. ; pascal Boolean IsValidIconRef(IconRef theIconRef)
  1570. ;
  1571.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1572.         Macro
  1573.         _IsValidIconRef
  1574.             moveq               #50,D0
  1575.             dc.w                $AA75
  1576.         EndM
  1577.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1578.         IMPORT_CFM_FUNCTION IsValidIconRef
  1579.     ENDIF
  1580.  
  1581.  
  1582.  
  1583. ;   PlotIconRef
  1584. ;   
  1585. ;   This routine plots the IconRef.  It mostly takes the same parameters as PlotIconSuite.
  1586. ;   Pass kIconServicesNormalUsageFlag as a default value for IconServicesUsageFlags.
  1587.  
  1588.  
  1589.  
  1590. ;
  1591. ; pascal OSErr PlotIconRef(const Rect *theRect, IconAlignmentType align, IconTransformType transform, IconServicesUsageFlags theIconServicesUsageFlags, IconRef theIconRef)
  1592. ;
  1593.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1594.         Macro
  1595.         _PlotIconRef
  1596.             moveq               #14,D0
  1597.             dc.w                $AA75
  1598.         EndM
  1599.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1600.         IMPORT_CFM_FUNCTION PlotIconRef
  1601.     ENDIF
  1602.  
  1603.  
  1604.  
  1605. ;   PtInIconRef
  1606. ;   
  1607. ;   This routine indicates if testPt would hit the icon designated by iconRef.
  1608. ;   It mostly takes the same parameters as PtInIconSuite.
  1609. ;   Pass kIconServicesNormalUsageFlag as a default value for IconServicesUsageFlags.
  1610.  
  1611.  
  1612.  
  1613.  
  1614. ;
  1615. ; pascal Boolean PtInIconRef(const Point *testPt, const Rect *iconRect, IconAlignmentType align, IconServicesUsageFlags theIconServicesUsageFlags, IconRef theIconRef)
  1616. ;
  1617.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1618.         Macro
  1619.         _PtInIconRef
  1620.             moveq               #15,D0
  1621.             dc.w                $AA75
  1622.         EndM
  1623.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1624.         IMPORT_CFM_FUNCTION PtInIconRef
  1625.     ENDIF
  1626.  
  1627.  
  1628.  
  1629. ;   RectInIconRef
  1630. ;   
  1631. ;   This routine indicates if testRect would intersect the icon designated by iconRef.
  1632. ;   It mostly takes the same parameters as RectInIconSuite.
  1633. ;   Pass kIconServicesNormalUsageFlag as a default value for IconServicesUsageFlags.
  1634.  
  1635.  
  1636.  
  1637.  
  1638. ;
  1639. ; pascal Boolean RectInIconRef(const Rect *testRect, const Rect *iconRect, IconAlignmentType align, IconServicesUsageFlags iconServicesUsageFlags, IconRef theIconRef)
  1640. ;
  1641.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1642.         Macro
  1643.         _RectInIconRef
  1644.             moveq               #16,D0
  1645.             dc.w                $AA75
  1646.         EndM
  1647.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1648.         IMPORT_CFM_FUNCTION RectInIconRef
  1649.     ENDIF
  1650.  
  1651.  
  1652.  
  1653. ;   IconRefToRgn
  1654. ;   
  1655. ;   This routine returns a region for the icon.
  1656. ;   It mostly takes the same parameters as IconSuiteToRgn.
  1657. ;   Pass kIconServicesNormalUsageFlag as a default value for IconServicesUsageFlags.
  1658.  
  1659.  
  1660.  
  1661. ;
  1662. ; pascal OSErr IconRefToRgn(RgnHandle theRgn, const Rect *iconRect, IconAlignmentType align, IconServicesUsageFlags iconServicesUsageFlags, IconRef theIconRef)
  1663. ;
  1664.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1665.         Macro
  1666.         _IconRefToRgn
  1667.             moveq               #17,D0
  1668.             dc.w                $AA75
  1669.         EndM
  1670.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1671.         IMPORT_CFM_FUNCTION IconRefToRgn
  1672.     ENDIF
  1673.  
  1674.  
  1675.  
  1676. ;   GetIconSizesFromIconRef
  1677. ;   
  1678. ;   This routine returns an IconSelectorValue indicating the depths and sizes of 
  1679. ;   icon data which are actually available.  It takes an IconSelectorValue 
  1680. ;   indicating which sizes/depths the caller is interested and returns an 
  1681. ;   IconSelectorValue indicating which sizes/depths exist.
  1682. ;   
  1683. ;   Caution:
  1684. ;   
  1685. ;   This is potentially an extremely expensive call as IconServices may be forced 
  1686. ;   to attempt fetching the data for the IconRef's sizes/depths which may result 
  1687. ;   in hitting the local disk or even the network to obtain the data to determine 
  1688. ;   which sizes/depths actually exist.
  1689. ;   Pass kIconServicesNormalUsageFlag as a default value for IconServicesUsageFlags.
  1690.  
  1691.  
  1692.  
  1693. ;
  1694. ; pascal OSErr GetIconSizesFromIconRef(IconSelectorValue iconSelectorInput, IconSelectorValue *iconSelectorOutputPtr, IconServicesUsageFlags iconServicesUsageFlags, IconRef theIconRef)
  1695. ;
  1696.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1697.         Macro
  1698.         _GetIconSizesFromIconRef
  1699.             moveq               #18,D0
  1700.             dc.w                $AA75
  1701.         EndM
  1702.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1703.         IMPORT_CFM_FUNCTION GetIconSizesFromIconRef
  1704.     ENDIF
  1705.  
  1706.  
  1707.  
  1708.  
  1709. ;  ==============================================================================
  1710. ;   Flushing IconRef data
  1711. ;  ==============================================================================
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717. ;   FlushIconRefs
  1718. ;   
  1719. ;   Making this call will dispose of all the data for the specified icons if 
  1720. ;   the data can be reacquired, for example if the data is provided from a resource.
  1721. ;   '****' is a wildcard for all types or all creators.
  1722.  
  1723.  
  1724.  
  1725. ;
  1726. ; pascal OSErr FlushIconRefs(OSType creator, OSType iconType)
  1727. ;
  1728.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1729.         Macro
  1730.         _FlushIconRefs
  1731.             moveq               #41,D0
  1732.             dc.w                $AA75
  1733.         EndM
  1734.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1735.         IMPORT_CFM_FUNCTION FlushIconRefs
  1736.     ENDIF
  1737.  
  1738.  
  1739.  
  1740. ;   FlushIconRefsByVolume
  1741. ;   
  1742. ;   This routine disposes of the data for the icons related to the indicated volume
  1743. ;   if this data can be reacquired, for example if the data is provided from a 
  1744. ;   resource.
  1745.  
  1746.  
  1747.  
  1748. ;
  1749. ; pascal OSErr FlushIconRefsByVolume(SInt16 vRefNum)
  1750. ;
  1751.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1752.         Macro
  1753.         _FlushIconRefsByVolume
  1754.             moveq               #24,D0
  1755.             dc.w                $AA75
  1756.         EndM
  1757.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1758.         IMPORT_CFM_FUNCTION FlushIconRefsByVolume
  1759.     ENDIF
  1760.  
  1761.  
  1762.  
  1763.  
  1764. ;  ==============================================================================
  1765. ;   Controling custom icons
  1766. ;  ==============================================================================
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772. ;   SetCustomIconsEnabled
  1773. ;   
  1774. ;   Enable or disable custom icons on the specified volume.
  1775.  
  1776.  
  1777.  
  1778. ;
  1779. ; pascal OSErr SetCustomIconsEnabled(SInt16 vRefNum, Boolean enableCustomIcons)
  1780. ;
  1781.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1782.         Macro
  1783.         _SetCustomIconsEnabled
  1784.             moveq               #31,D0
  1785.             dc.w                $AA75
  1786.         EndM
  1787.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1788.         IMPORT_CFM_FUNCTION SetCustomIconsEnabled
  1789.     ENDIF
  1790.  
  1791.  
  1792.  
  1793. ;   GetCustomIconsEnabled
  1794. ;   
  1795. ;   Return true if custom icons are enabled on the specified volume, false otherwise.
  1796.  
  1797.  
  1798.  
  1799. ;
  1800. ; pascal OSErr GetCustomIconsEnabled(SInt16 vRefNum, Boolean *customIconsEnabled)
  1801. ;
  1802.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1803.         Macro
  1804.         _GetCustomIconsEnabled
  1805.             moveq               #32,D0
  1806.             dc.w                $AA75
  1807.         EndM
  1808.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1809.         IMPORT_CFM_FUNCTION GetCustomIconsEnabled
  1810.     ENDIF
  1811.  
  1812.  
  1813.  
  1814.     ENDIF ; __ICONS__ 
  1815.  
  1816.